import React, { useState } from 'react'



function Child(props) {
  let { personList } = props
  console.log(props);
  return (
    <div>
      <div>子组件A</div>
      {
        personList.map((item) => (<ul key={item.id}>
          <li key={item.id}>
            姓名：{item.name}<br />
            年龄：{item.age}<br />
            性别：{item.sex}<br />
          </li>
        </ul>))
      }
    </div>
  )
}

export default function A1() {
  let [personList] = useState([{
    name: 'Tom',
    age: 18,
    sex: '男',
    id: '01'
  }])

  return (
    <div>
      <h2>A1.js 父传子</h2>
      父组件:
      <Child personList={personList}></Child>
    </div>
  )
}




